/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.vasthu.utility;

import java.net.URLEncoder;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 *
 * @author moremada
 */
public class HashUtil {

    /**
     * @inheritDoc
     */
    public static String hashString(String s) {
        MessageDigest sha = null;
        try {
            sha = MessageDigest.getInstance("SHA-1");
        } catch (NoSuchAlgorithmException e) {
        }
        sha.reset();
        sha.update(s.getBytes());
        return new String(Base64.encode(sha.digest()));
    }

}

